/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import dao.implementations.DaoFactory;
import dao.interfaces.UnitDao;
import engine.Unit;
import java.util.ArrayList;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

/**
 *
 * @author Johnny
 */
public class UnitDaoTester {

    public UnitDaoTester() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception {
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }

    @Before
    public void setUp() {
    }

    @After
    public void tearDown() {
    }

    @Test
    public void hello() {
        DaoFactory df = new DaoFactory();
        UnitDao udao = df.getUnitDao();
        ArrayList<Unit> unitList = udao.getUnits();
        for (Unit unit : unitList) {
            System.out.println(unit);
        }
        System.out.println();

        //udao.addUnit("24B");
        //udao.removeUnit(3);
        //udao.updateUnit(new Unit(1,"24B"));

//        udao.addToCourse(2, 13);
//        udao.addToCourse(2, 2);
//        df.getInstDao().addInstance(2);

//        udao.removeFromCourse(2, 2);



        unitList = udao.getUnits();
        for (Unit unit : unitList) {
            System.out.println(unit);
        }
    }
}
